export const banner = [
  require("./../../public/banner.png"),
  require("./../../public/banner1.png"),
  require("./../../public/banner2.png"),
  require("./../../public/banner3.png")
];

export const headers = [
  {
    name: "首页",
    to: "index"
  },
  {
    name: "关于柏煊",
    to: "about"
  },
  {
    name: "讲师介绍",
    to: "teacher"
  },
  {
    name: "课程培训",
    to: "course"
  },
  {
    name: "学员作品",
    to: "works"
  }
];
export const scrollTo = $ToDom => {
  scrollAnimation($ToDom.offsetTop);
};

/**
 *
 * @param {*coordinate} y
 * @param {*ms} duration
 */
function scrollAnimation(y, duration = 35) {
  // console.log($);
  // current upward px
  // $(“html,body”).animate({scrollTop:$(“#box”).offset().top},1000)
  // console.log(y);
  // const scrollTop = document.body.scrollTop;
  // const distance = y - scrollTop;
  // const scrollCount = duration;
  // const everyDistance = distance / scrollCount;
  // for (let index = 1; index <= scrollCount; index++) {
  // setTimeout(function() {
  window.scrollTo(0, y);
  // }, 10 * index);
  // }
}
